#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

char decode(char c, char e)
{
	int n = e - 'A';
	if(c>='a' && c <='z') {
		e = 'a';
	}
	else {
		e = 'A';
	}
	n = c - e - n;
	if( n < 0 ) {
		n = 26 + n;
	}
	return e + n;
}

int main()
{
	string s1;
	string s2;
	cin >> s1 >> s2;
	for_each(s1.begin(), s1.end(), [](char &c) { c = toupper(c);});
	int n=0;
	for(int i=0; i<s2.length(); i++) {
		n = i % s1.length();
		cout << decode(s2[i], s1[n]);
	}
	return 0;
}
